package com.yc.booktable.service.impl;

import com.yc.booktable.entity.Feedback;
import com.yc.booktable.mapper.FeedbackMapper;
import com.yc.booktable.service.IFeedbackService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yc.booktable.vo.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zbh
 * @since 2022-06-06
 */
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements IFeedbackService {

    @Resource
    private FeedbackMapper feedbackMapper;
    @Override
    public Result add(String message,Long sid) {
        int insert = feedbackMapper.insert(new Feedback(0, sid, message, 0));
        if(insert==1){
            return new Result(1,"插入成功",null);
        }else{
            return new Result(0,"插入失败",null);
        }
    }
}
